!===============================================================
!
! 5**n minimi locali (LEVY 5)
!
!===============================================================
!			VARIABLE BOUNDS
!===============================================================
!       -1.D+1               1.D+1         Limits of variable i

SUBROUTINE LEVY5(X,N,F)

      IMPLICIT NONE

      INTEGER          :: N
      DOUBLE PRECISION :: X(N), F

      DOUBLE PRECISION, PARAMETER :: PG = 3.1415923D0
      DOUBLE PRECISION, PARAMETER :: CT = 25.D-2
      DOUBLE PRECISION, PARAMETER :: RK = 10.D0
      DOUBLE PRECISION, PARAMETER :: RA = 1.D0

      INTEGER          :: I


      F = RK*DSIN(PG*(1.D0+CT*(X(1)-1.D0)))**2

      DO I=1,N-1
         F = F+(((1.D0+CT*(X(I)-1.D0))-RA)**2)*(1.D0+RK*DSIN(PG*&
             (1.D0+CT*(X(I+1)-1.D0)))**2)
      END DO

      F = F + ((1.D0+CT*(X(N)-1.D0))-RA)**2

      F = (PG/DBLE(N))*F

      RETURN

END
